#%RAML 1.0

    title: Party API
    baseUri: http://localhost:8081
    version: v1

    documentation:
      - title: mod-party API
        content: This documents the API calls that can be made to post party for users, and to get them

    types:
      calendar: !include calendar.json
      calendarCollection: !include calendarCollection.json
      property: !include property.json
      propertyCollection: !include propertyCollection.json
      attend: !include attend.json
      attendCollection: !include attendCollection.json
      reserve: !include reserve.json
      reserveCollection: !include reserveCollection.json
      partyWebDetailsInfo:  !include partyWebDetailsInfo.json
      partyWebDetailsInfoCollection: !include partyWebDetailsInfoCollection.json
      webReserveData: !include webReserveData.json
      webReserveDataCollection: !include webReserveDataCollection.json
      readerReserveChangeRequest: !include readerReserveChangeRequest.json
      readerReserveChangeResponse: !include readerReserveChangeResponse.json
      appraisal: !include appraisal.json
      appraisalCollection: !include appraisalCollection.json
      party: !include party.json
      partyCollection: !include partyCollection.json
      errors: !include raml-util/schemas/errors.schema

    traits:
      validate: !include raml-util/traits/validation.raml
      language: !include raml-util/traits/language.raml
      pageable:  !include raml-util/traits/pageable.raml
      searchable: !include raml-util/traits/searchable.raml

    resourceTypes:
      collection: !include raml-util/rtypes/collection.raml
      collection-item: !include raml-util/rtypes/item-collection.raml
      collection-get: !include raml-util/rtypes/collection-get.raml
      collection-post: !include raml-util/rtypes/collection-post.raml
      collection-item-get: !include raml-util/rtypes/item-collection-get.raml
      post-empty-body: !include raml-util/rtypes/post-empty-body.raml

    /party/web/info:
      displayName: party web
      description: 读者移动端及网页端访问活动数据端接口
      type:
        collection-get:
          schemaCollection: partyCollection
          schemaItem: party
          exampleCollection: !include examples/partyCollection.sample
          exampleItem: !include examples/party.sample
      get:
        is: [
          searchable: {description: "根据相应的条件查询返回到读者端一些活动数据", example: "query=(isDel = 0 and approval = 1  and status = 1 and isCalendar = 0)"},
          pageable,
          validate
        ]

      /details/{barcode}/and/{id}:
          displayName: partyWebDetailsInfo
          description:  获取一个活动的详情
          type:
             collection-get:
                schemaCollection: partyWebDetailsInfo
                schemaItem: partyWebDetailsInfo
                exampleCollection: !include examples/partyWebDetailsInfo.sample
                exampleItem: !include examples/partyWebDetailsInfo.sample

      /participation:
          displayName: party info
          description: 获取读者参与活动端信息
          type:
             collection:
                schemaCollection: webReserveDataCollection
                schemaItem: webReserveData
                exampleCollection: !include examples/webReserveDataCollection.sample
                exampleItem: !include examples/webReserveData.sample
          get:
             is: [
               searchable: {description: "根据相应的条件获取读者参与活动的信息", example: "query=(isDel = 0 and readerReserveGroup == * )"},
                pageable,
                validate
                ]
          post:
             is: [validate]

      /participation_change:
                displayName: party info
                description: 读者对参与信息进行变更
                type:
                   post-empty-body:
                      schema: readerReserveChangeResponse
                      exampleItem: !include examples/readerReserveChangeResponse.sample
                post:
                  is: [validate]
                  body:
                    application/json:
                     type: readerReserveChangeRequest
                     example:
                      strict: false
                      value:  !include examples/readerReserveChangeRequest.sample

#      /reader_attend/{id}:
#          displayName: party info
#          description: 读者进行签到接口
#          type:
#            collection:
#               schemaCollection: attendCollection
#               schemaItem: attend
#               exampleCollection: !include examples/attendCollection.sample
#               exampleItem: !include examples/attend.sample

      /reader_reserve/{id}:
             displayName: party reserve
             description: 读者进行预约接口
             type:
                collection-post:
                   schemaCollection: reserveCollection
                   schemaItem: reserve
                   exampleCollection: !include examples/reserveCollection.sample
                   exampleItem: !include examples/reserve.sample

      /calendar:
             displayName: party reserve
             description: 活动日历接口
             type:
                collection-get:
                   schemaCollection: calendarCollection
                   schemaItem: calendar
                   exampleCollection: !include examples/calendarCollection.sample
                   exampleItem: !include examples/calendar.sample
             get:
               is: [
                 searchable: {description: "活动日历接口,返回日历数据", example: "query=2020-02-02"},
                 validate
               ]

#      /reader_schedule/{id}:
#                  displayName: party reserve
#                  description: 读者日程接口
#                  type:
#                     collection:
#                        schemaCollection: partyCollection
#                        schemaItem: party
#                        exampleCollection: !include examples/partyCollection.sample
#                        exampleItem: !include examples/party.sample
      /property:
             displayName: party reserve
             description: 活动属性分类接口
             type:
                collection-get:
                   schemaCollection: propertyCollection
                   schemaItem: property
                   exampleCollection: !include examples/propertyCollection.sample
                   exampleItem: !include examples/property.sample
             get:
                 is: [
                     searchable: {description: "查询一些活动属性", example: "query=(isDel = 0)"},
                     pageable,
                     validate
                  ]
      /appraisal:
                   displayName: party appraisal
                   description: 活动评论接口
                   type:
                      collection:
                         schemaCollection: appraisalCollection
                         schemaItem: appraisal
                         exampleCollection: !include examples/appraisalCollection.sample
                         exampleItem: !include examples/appraisal.sample
                   get:
                       is: [
                           searchable: {description: "查询一些活动评论", example: "query=(id = * )"},
                           pageable,
                           validate
                        ]
                   post:
                           is: [validate]

      /appraisal/detail/{id}:
                      displayName: get Appraisal by id
                      description: 获取一条单独的活动评论
                      type:
                         collection-item-get:
                            schema: appraisal
                            exampleItem: !include examples/appraisal.sample

      /reserve_queue:
                      displayName: party reserve queue
                      description: 读者报名排队查询接口
                      type:
                        collection:
                          schemaCollection: reserveCollection
                          schemaItem: reserve
                          exampleCollection: !include examples/reserveCollection.sample
                          exampleItem: !include examples/reserve.sample
                      get:
                        is: [
                         searchable: {description: "查询一些活动评论", example: "query=(id = * )"},
                         pageable,
                         validate
                        ]
                      post:
                        is: [validate]